<template>
	<view class="extend">
		<view class="bgc">

		</view>
		<view class="info">
			<view class="info-weixin">
				<text>{{ user.nickname }}</text>
				<view class="info-img">
					<image :src="user.avatar" mode=""></image>
				</view>
			</view>
			<view class="extract">
				<view class="tixian">
					<text>可提现 {{ moneyDetail.money }} 元</text>
					<text>待提现 {{ moneyDetail.money }} 元</text>
				</view>
			</view>
			<view class="money">
				<text>已提现金额</text>
				<text>{{ moneyDetail.tixian }} 元</text>
			</view>
		</view>

		<view class="details">
			<view class="detail" @click="goToPage('/pages/user/child/syDetail')">
				<image style="width: 50upx; height: 54upx;" src="/static/images/shop/dd.png" mode=""></image>
				<text>收益订单</text>
			</view>
			<view class="detail" @click="goToPage('/pages/user/child/tuandui')">
				<image style="width: 50upx; height: 54upx;" src="/static/images/shop/team.png" mode=""></image>
				<text>我的团队</text>
			</view>
			<view class="detail" @click="goToPage('/pages/user/child/code-share')">
				<image style="width: 50upx; height: 54upx;" src="/static/images/shop/qrcode.png" mode=""></image>
				<text>推广二维码</text>
			</view>
			<view class="detail" @click="goToPage('/pages/user/child/draw')">
				<image style="width: 50upx; height: 54upx;" src="/static/images/shop/cj.png" mode=""></image>
				<text>抽奖</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				qrCodeImg: '',
				moneyDetail: {}
			}
		},
		computed: {
			...mapState(['user'])
		},
		onLoad() {
			this.getUserCurrentMoney();
		},
		methods: {
			goToPage(url) {
				uni.navigateTo({
					url
				})
			},
			
			//查看当前用户余额
			getUserCurrentMoney() {
				this.$api.post({
					url: '/user/getMoney',
					success: (res) => {
						this.moneyDetail = res;
					}
				})
			},
			//查看推广二维码
			
		}
	}
</script>

<style scoped lang="scss">
	page,
	.extend {
		width: 100%;
		height: 100%;
		color: #333;
	}

	.bgc {
		width: 100%;
		height: 200upx;
		background-color: #4c86ff;
	}

	.info {
		width: 92%;
		height: 380upx;
		position: absolute;
		top: 120upx;
		left: 4%;
		padding: 0 30upx;
		background-color: #fff;
		box-shadow: 2upx 2upx 2upx 2upx #ccc;
		border-radius: 20upx;

		.info-weixin {
			padding: 20upx 0;
			border-bottom: 1upx solid #f1f1f1;
			font-size: 32upx;

			.info-img {
				width: 125upx;
				height: 125upx;
				position: absolute;
				top: -50upx;
				right: 50upx;

				image {
					width: 100%;
					height: 100%;
					border-radius: 50%;
					float: right;
					border: 1upx solid #fff;
				}
			}
		}

		.extract {
			width: 100%;
			height: 200upx;
			background-color: #8d83fb;
			margin-top: 20upx;
			border-radius: 10upx;
			color: #fff;
			display: flex;
			justify-content: space-around;
			align-items: center;

			.tixian {
				height: 100upx;
				font-size: 28upx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
			}

			.btn {
				width: 150upx;
				height: 50upx;
				line-height: 50upx;
				border-radius: 25upx;

				button {
					width: 100%;
					height: 100%;
					font-size: 28upx;
					line-height: 50upx;
					border-radius: 25upx;
					color: #8d83fb;
				}
			}

		}

		.money {
			display: flex;
			justify-content: space-between;
			font-size: 28upx;
			color: #333;
			margin-top: 10upx;
		}

	}

	.details {
		width: 92%;
		height: 300upx;
		background-color: #fff;
		box-shadow: 2upx 2upx 2upx 2upx #ccc;
		margin: 350upx auto 0;
		border-radius: 20upx;
		display: flex;
		align-items: center;
		flex-wrap: wrap;

		.detail {
			width: 33%;
			height: 100upx;
			// padding: 0 5%;
			font-size: 24upx;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-around;
		}
	}
</style>
